package cate.game.pvp.ladder.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBLadder;
import cate.game.res.MixRes;
import cate.game.role.RoleSnapshot;
import cate.game.role.pvp.PvpRecord;
import easy.java.dev.note.NoteField;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@ClientMsg(title = "天梯赛 挑战 の 返回")
public class LadderChallengeResp implements MsgOutput {

    public LadderChallengeResp(PvpRecord record, MixRes reward) {
        this.winner = record.winner;
        this.snapshotA = record.snapshotA;
        this.snapshotB = record.snapshotB;
        this.rankA = (int) record.valueA;
        this.rankB = (int) record.valueB;
        this.rankChangedA = (int) record.valueChangeA;
        this.rankChangedB = (int) record.valueChangeB;
        this.reward = reward;
    }

    @NoteField(value = "获胜方")
    public byte winner;

    @NoteField(value = "A的简要数据")
    public RoleSnapshot snapshotA;

    @NoteField(value = "B的简要数据")
    public RoleSnapshot snapshotB;

    @NoteField(value = "A的当前排名")
    public int rankA;

    @NoteField(value = "B的当前排名")
    public int rankB;

    @NoteField(value = "A的排名变化")
    public int rankChangedA;

    @NoteField(value = "B的排名变化")
    public int rankChangedB;

    @NoteField(value = "获得的奖励")
    public MixRes reward;

    @Override
    public MsgConfig conf() {
        return MsgIdBLadder.CHALLENGE_RESP;
    }

}
